package com.info.zhiduoduo.admin.controller;

import com.info.zhiduoduo.admin.model.formbean.evaluate.QueryEvaluateNoticeFrombean;
import com.info.zhiduoduo.admin.model.formbean.evaluate.SaveEvaluateNoticeFormBean;
import com.info.zhiduoduo.admin.service.EvaluateNoticeService;
import com.info.zhiduoduo.common.annotation.ZddLog;
import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.formbean.BaseSimpleFormBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/evaluate/notice")
@Api(tags = "评价公告接口")
public class EvaluateNoticeController {

	@Resource
	EvaluateNoticeService evaluateNoticeService;

	@ZddLog(name = "创建并发送评价公告")
	@PostMapping("/saveEvaluateNotice")
	@ApiOperation("创建并发送评价公告")
	public SmartResult saveEvaluateNotice(@Valid @RequestBody BaseSimpleFormBean<SaveEvaluateNoticeFormBean> formBean) {
		return evaluateNoticeService.saveEvaluateNotice(formBean);
	}

	@PostMapping("/queryEvaluateNoticeList")
	@ApiOperation("查询评价公告列表")
	public SmartResult queryEvaluateNoticeList(@Valid @RequestBody BaseSimpleFormBean<QueryEvaluateNoticeFrombean> formBean) {
		return evaluateNoticeService.queryEvaluateNoticeList(formBean);
	}

}
